import UnitCommon from 'code/Core/Common/UnitCommon';
import AbilityBase from 'code/Scripts/Abilities/base/AbilityBase';
/**
 * 王阳指
 **/
export default class WS_OneSunHit extends AbilityBase {
    static instance: WS_OneSunHit;
    constructor(id: string = 'Ayyz') {
        super(id);
        WS_OneSunHit.instance = this;
        this.init();
        se.onUnitSpellEffect(this.onSpellEffect.bind(this), this.id);
    }
    init() {}
    cast<T extends Object = any>(tarX: number, tarY: number, source: unit, target: unit, data?: T): void {
        let lv = this.getAbilityLevel(source);
        let dmg = 80 * lv + UnitCommon.取攻击(source) * (0.5 + 0.3 * lv);
        DamageSystemInstance.applyAttackDamage(target, source, dmg, this.id);
        StunSystemIntance.stun(target, 3, source);
    }
    onSpellEffect() {
        this.cast(GetSpellTargetX(), GetSpellTargetY(), GetTriggerUnit(), GetSpellTargetUnit());
    }
}
